/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/13 14:24
  *
  * @file       pd_timer_pwm.h
  * @brief      Header file of TimerPWM peripheral driver.
  *
  * @note       This file contains the TimerPWM object declaration.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/13     Chris        the first version
  *
  ******************************************************************************
  */

#ifndef JLC_SKY_TIMER_PWM_H
#define JLC_SKY_TIMER_PWM_H

#include "pd_gpio.h"
#include "pd_timer.h"
#include "pd_timer_oc.h"
#include "drivers.h"

typedef struct TimerPWMDef TimerPWM;

struct TimerPWMDef {
    Timer *timer;
    TimerOC *timerOC;

    void (*init)(TimerPWM *this);

    void (*setPWMDuty)(TimerPWM *this, const uint32_t channel, const uint32_t val);
};

extern const struct TimerPWMClass {
    TimerPWM *(*build)(Timer *timer, TimerOC *timerOC);
} TimerPWMBuilder;

#endif //JLC_SKY_TIMER_PWM_H
